//
//  CivilCardView.m
//  SUZHOUBANK
//
//  Created by saberLily on 16/4/11.
//  Copyright © 2016年 RuiFeng-WGCC. All rights reserved.
//

#import "CivilCardView.h"
#import "TopMenusView.h"
#import "CivilDetailView.h"
@interface CivilCardView()<TopMenusViewDelegate>
{
    NSArray *_dataSource;
}
@property (nonatomic,strong) TopMenusView *topMenusView; /**< 顶部 */
@property (nonatomic,strong) CivilDetailView *detailView;

@end
@implementation CivilCardView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self initializeDataSource];
        [self initializeUserInterface];

    }
    return self;
}
#pragma mark - initializeDataSource 初始化数据源
-(void)initializeDataSource{
    
}

#pragma mark - initializeUserInterface 初始化用户界面
-(void)initializeUserInterface{
    [self addSubview:self.topMenusView];
    [self addSubview:self.detailView];
}

#pragma mark *** delegate ***
-(void)topMenusView:(TopMenusView *)topMenusView didSelectedItemIndexPathRow:(NSInteger)indexPathRow{
    self.detailView.detaiLabel.text = self.topMenusView.dataSource[indexPathRow];
}
#pragma mark *** getters ***
-(TopMenusView *)topMenusView{
    if (!_topMenusView) {
        _topMenusView = [[TopMenusView alloc]initWithFrame:CGRectMake(30, 20, CGRectGetWidth(self.bounds)-40, 40) dataSource:@[@"功能介绍",@"激活情况",@"金融使用指南",@"挂失",@"申办流程",@"补卡",@"密码管理",@"8大免费",@"常见问题",@"银医一卡通",@"服务中心"]];
        _topMenusView.delegate = self;
        
    }
    return _topMenusView;
}
-(CivilDetailView *)detailView{
    if (!_detailView) {
        _detailView = [[CivilDetailView alloc] initWithFrame:CGRectMake(30, 80, CGRectGetWidth(self.bounds)-40, 800)];
        
    }
    return _detailView;
}
@end
